package com.yan.demo;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

/**
 * @author taoge
 * @Date 2024/8/6 16:37
 * @Description 操作配置文件
 */
public class Demo7 {
    public static void main1(String[] args) throws IOException {
        Properties map = new Properties();
        map.setProperty("zhangsan" ,"18");
        map.setProperty("lisi" ,"19");
        map.setProperty("wangwu" ,"20");
        map.store(new FileOutputStream("day12_code/src/com/yan/demo/mySql.properties") , "key=value");
       // map.load(new FileReader("day12_code/src/com/yan/demo/mySql.properties"));
    }

    public static void main(String[] args) throws IOException {
        Properties map = new Properties();
        map.load(new FileReader("day12_code/src/com/yan/demo/mySql.properties"));
        System.out.println(map);
    }
}
